﻿using System;
using System.Diagnostics;
using System.Windows.Forms;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using HYCodeBase.WinForm;
using RevitInteractiveUtility.ExternalEventManager;

namespace SampleAndTest.ExternalEventManager.MultiFromDemo
{
	[Transaction(TransactionMode.Manual)]
	public class CmdTestExternalEventMutiForm : IExternalCommand
	{
		public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
			try
			{
				WindowHandle owner = new WindowHandle(Process.GetCurrentProcess().MainWindowHandle);
				ExternalEventManagerSingleton.GetEventManger(false).ReSetRequest();
				System.Windows.Forms.Form form = new MultiForm1(commandData);
				MultiForm2 multiForm = new MultiForm2(commandData);
				form.Show(owner);
				multiForm.Show(owner);
			}
			catch
			{
			}
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
